package com.tech.connect.api;

import java.util.HashMap;
import java.util.Map;

import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.POST;

public class AuthHttp {
    public static Map<String, Object> getMap() {
        return new HashMap<>();
    }

    public interface ConnectApiServer {
        @POST("v1/my/auth/info")
        Observable<BaseEntity<Map<String, Object>>> info();

        @POST("v1/my/auth/user-mobile-auth/create")
        Observable<BaseEntity<Object>> authPhone(@Body Map<String, Object> map);

        @POST("v1/my/auth/user-identity-auth/create")
        Observable<BaseEntity<Object>> authCard(@Body Map<String, Object> map);

        @POST("v1/my/auth/user-skill-auth/create")
        Observable<BaseEntity<Object>> authSkill(@Body Map<String, Object> map);

        @POST("v1/my/auth/user-skill-auth/list")
        Observable<BaseEntity<Object>> skills(@Body Map<String, Object> map);
    }

    public static Observable<BaseEntity<Map<String, Object>>> info(final BaseEntityOb<Map<String, Object>> ob) {
        return ob.bindObed(ConnectApiManager.getApiServer(ConnectApiServer.class).info());
    }

    public static Observable<BaseEntity<Object>> authPhone(@Body Map<String, Object> map, final BaseEntityOb<Object> ob) {
        return ob.bindObed(ConnectApiManager.getApiServer(ConnectApiServer.class).authPhone(map));
    }

    public static Observable<BaseEntity<Object>> skills(@Body Map<String, Object> map, final BaseEntityOb<Object> ob) {
        return ob.bindObed(ConnectApiManager.getApiServer(ConnectApiServer.class).skills(map));
    }

    public static Observable<BaseEntity<Object>> authCard(@Body Map<String, Object> map, final BaseEntityOb<Object> ob) {
        return ob.bindObed(ConnectApiManager.getApiServer(ConnectApiServer.class).authCard(map));
    }

    public static Observable<BaseEntity<Object>> authSkill(@Body Map<String, Object> map, final BaseEntityOb<Object> ob) {
        return ob.bindObed(ConnectApiManager.getApiServer(ConnectApiServer.class).authSkill(map));
    }

}
